package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * Created by Administrator on 2016/7/7.
 */
public class ChangeUserNameAction extends AHttpService<PbBean.PbResUserChangeUsername> {
    private String userName;
    private String password;

    public static ChangeUserNameAction newInstance(Context context, String userName, String password) {
        return new ChangeUserNameAction(context, userName, password);
    }

    private ChangeUserNameAction(Context context, String userName, String password) {
        super(context);
        this.userName = userName;
        this.password = password;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqUserChangeUsername.Builder builder = PbBean.PbReqUserChangeUsername.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setUsername(userName);
        builder.setPassword(password);
        return apiService.changeUserName(builder.build());
    }
}
